package com.yuanfeng.business.feign;

import com.yuanfeng.commoms.dto.goods.AppSeckillGoodsVO;
import com.yuanfeng.commoms.dto.goods.ManjianzengzheGoodsRuleQueryDTO;
import com.yuanfeng.commoms.vo.activity.AppDiscountGoodsQueryResultVO;
import com.yuanfeng.commoms.vo.activity.AppPintuanGoodsQueryResultVO;
import com.yuanfeng.commoms.vo.activity.AppSeckillGoodsQueryResultVO;
import com.yuanfeng.commoms.vo.activity.ManjianzengzheGoodsQueryResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author Stranger
 * @date 2023/4/7 10:55
 */
@FeignClient(name = "mall-activity", url = "http://localhost:8084")
public interface ActivityServiceClient {

    /**
     * 查询秒杀活动信息 feign
     */
    @PostMapping("activity/seckillGoods/selectSeckillByGoodsId")
    public AppSeckillGoodsQueryResultVO selectSeckillByGoodsId(@RequestBody Map<String, Object> map);
    /**
     * 查询限时折扣活动信息 feign
     */
    @PostMapping("activity/discountGoods/selectByGoodsId")
    public AppDiscountGoodsQueryResultVO selectDiscountByGoodsId(@RequestParam("goodsId") Integer goodsId);

    /**
     * 查询拼团活动信息 feign
     */
    @PostMapping("activity/piecingTogether/selectByGoodsId")
    public AppPintuanGoodsQueryResultVO selectpiecingTogetherByGoodsId(@RequestParam("commonId") Integer commonId, @RequestParam("goodsId") Integer goodsId);

    /**
     * 查询满减增折活动信息 feign
     */
    @PostMapping("activity/reductionPolicyBase/selectByGoodsId")
    public ManjianzengzheGoodsQueryResultVO selectReductionPolicyByGoodsId(@RequestParam("commonId") Integer commonId);

    /**
     * 查询秒杀活动信息 feign
     */
    @PostMapping("/activity/seckillGoods/selectSeckillByGoodsId2")
    AppSeckillGoodsQueryResultVO selectSeckillByGoodsId2(@RequestParam("goodsId") Integer goodsId);

    /**
     * 查询满减增折活动规则
     * @param promotionId
     * @return
     */
    @PostMapping("activity/reductionPolicyBase/selectList")
    List<ManjianzengzheGoodsRuleQueryDTO> selectReductionPolicyRuleDetailList(@RequestParam("promotionId")Integer promotionId);

    /**
     * 查询秒杀活动信息 feign
     */
    @PostMapping("activity/seckillGoods/selectByGoodsId")
    AppSeckillGoodsVO selectByGoodsId(@RequestBody Map<String,Object> map);
}
